﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using PerCederberg.Grammatica.Runtime;
using SafeScript.MetaModel;

namespace SafeScript
{
    class Program
    {
        static void Main(string[] args)
        {
            Compiler compiler = new Compiler();
            compiler.ImportPaths.Add(@"..\..\");
            compiler.ImportPaths.Add(@"..\..\Library");
            // compiler.ParseFile("..\\..\\Test4.ss");
            compiler.ParseFiles(new string[] { "Test8.ss" });
            if (compiler.ErrorReport.Count > 0)
                compiler.PrintErrors();
            else
            {
                compiler.Compile();
                if (compiler.ErrorReport.Count > 0)
                    compiler.PrintErrors();
                else
                {
                    compiler.Generate("../../../../Web/Gadget2/gadget.js", "WaveDemo", SafeScript.Generator.OutputType.Wave);
                    if (compiler.ErrorReport.Count > 0)
                        compiler.PrintErrors();
                }
            }

            Console.WriteLine("Done");
            Console.ReadLine();
        }
    }
}
